# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=fontobene-qt5
pkgver=0.2.0
pkgrel=3
pkgdesc='A header-only library to parse FontoBene stroke fonts with C++/Qt5'
arch=(any)
url=https://github.com/fontobene/fontobene-qt5
license=(MIT Apache)
depends=(qt5-base)
makedepends=(qt5-tools)
source=($url/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha512sums=('7885f78a118d08a0675687cbd24a899d579b6a8758e7249f52bba81fd9e46b6ad3f1cc2e37ff5913b47f177cfb582e4ca388ba8239d4b480e745f652ff59a24a')
b2sums=('1d95515071502d83919536e1ce3a9eebba55278c03007f591a2c0edc346964e4fd37cfba5d9d35ad7a767e451ceabd3034d98f2de055aa3664cd27ec3747467b')

build() {
  local qmake_options=(
    PREFIX=/usr
    QMAKE_CFLAGS_RELEASE="$CFLAGS"
    QMAKE_CXXFLAGS_RELEASE="$CXXFLAGS"
  )

  cd $pkgname-$pkgver
  qmake "${qmake_options[@]}"
  make
}

check() {
  make check -C $pkgname-$pkgver
}

package() {
  make INSTALL_ROOT="$pkgdir" install -C $pkgname-$pkgver
  install -Dm 644 $pkgname-$pkgver/$pkgname.pc.example "$pkgdir"/usr/lib/pkgconfig/$pkgname.pc
  install -Dm 644 $pkgname-$pkgver/LICENSE-* -t "$pkgdir"/usr/share/licenses/$pkgname/
}

